import { Entity, Column, JoinColumn, ManyToOne, OneToOne } from 'typeorm'
import { Staff } from 'src/modules/staff/entities/staff.entity'
import { Department } from 'src/modules/department/entities/department.entity'
import { Account } from 'src/modules/account/entities/account.entity'
import { App } from 'src/app.entity'
@Entity()
export class Job extends App {
  @Column({ type: 'varchar', length: 10 })
  name: string
  @ManyToOne(() => Account)
  @JoinColumn({ name: 'account_id' })
  account: Account
  @ManyToOne(() => Department)
  @JoinColumn({ name: 'department_id' })
  department: Department
  @OneToOne(() => Staff, staff => staff.job)
  staff: Staff
  @Column({ type: 'varchar', length: 50, nullable: true })
  desc?: string
}
